package application.init;

import application.exception.NoModeException;
import javafx.scene.input.DragEvent;
import javafx.scene.input.TransferMode;

public class EventInit {

    public static final int COPY = 0x01;
    public static final int MOVE = 0x02;
    public static final int LINK = 0x03;

    public static final int ANY = 0x04;
    public static final int COPY_OR_MOVE = 0x05;
    public static final int NONE = 0x06;

    // TODO 使用注解调用
    public static void setOnDragOver(int flag, DragEvent event) {
        switch (flag) {
            case COPY:
                event.acceptTransferModes(TransferMode.COPY);
                break;
            case MOVE:
                event.acceptTransferModes(TransferMode.MOVE);
                break;
            case LINK:
                event.acceptTransferModes(TransferMode.LINK);
                break;
            case ANY:
                event.acceptTransferModes(TransferMode.ANY);
                break;
            case COPY_OR_MOVE:
                event.acceptTransferModes(TransferMode.COPY_OR_MOVE);
                break;
            case NONE:
                event.acceptTransferModes(TransferMode.NONE);
                break;
            default:
                throw new NoModeException("Not found mode exception");
        }
    }

    // TODO 使用注解调用
    public interface MouseMoveInEvent {
        void inListener();
    }

    // TODO 使用注解调用
    public interface MouseMoveOutEvent {
        void outListener();
    }
}
